package util

import org.apache.spark.SparkConf
import org.apache.spark.sql.SparkSession

object SparkUtil {
  def getSparkSession(appName: String = "app", master: String = "local[4]", confMap: Map[String, String] = Map.empty): SparkSession = {
    val conf: SparkConf = new SparkConf()
    conf.setAll(confMap)
    SparkSession.builder().appName(appName).master(master).config(conf).getOrCreate()
  }
}
